import ProForm, { ModalForm, ProFormText, ProFormTreeSelect } from "@ant-design/pro-form";
import { Button } from "antd";

export default (props: any) => {
    <div>
        {/* 编辑用户的信息 */}
        <ModalForm
            // visible={editModal}
            title="编辑用户"
            // onVisibleChange={setEditModal}
            trigger={
                <Button>新建数据</Button>
            }
            onFinish={async (values) => {

            }}
        >
            <ProForm.Group>
                <ProFormText name="username" required rules={[{ required: true, message: "输入用户名" }]} placeholder="输入用户名" width="md" label="用户名" />
                <ProFormTreeSelect
                    name="depart_id"
                    request={() => {
                        return tree;
                    }}
                    required
                    rules={[{ required: true, message: "部门信息不能为空" }]}
                    placeholder="选择部门"
                    width="md"
                    label="用户部门"
                    fieldProps={{
                        fieldNames: {
                            value: 'id',
                            label: 'name',
                        }
                    }}

                />
            </ProForm.Group>

            <ProForm.Group>
                <ProFormText width="md" placeholder="输入用户邮箱" label="邮箱" name="email"
                    required
                    rules={[{ required: true, message: "部门信息不能为空" }]} />
                <ProFormText.Password width="md" label="密码" placeholder="输入用户密码" name="password"
                    required
                    rules={[{ required: true, message: "部门信息不能为空" }]} />
            </ProForm.Group>
            <ProForm.Group>
                <ProFormRadio.Group required
                    rules={[{ required: true, message: "选择状态" }]} name="mg_status" label="状态" options={[{ label: '关闭', value: 0 }, { label: '开启', value: 1 }]} />
            </ProForm.Group>
        </ModalForm>
    </div>
}